from rest_framework import viewsets
from rest_framework.permissions import AllowAny
from apps.articles.models import Article
from apps.articles.serializers import ArticleSerializer
from apps.common.paginator import MyPageNumberPagination


class ArticleViewSet(viewsets.ReadOnlyModelViewSet):
    """
    API endpoint that allows Subscriptions to be viewed, created, updated or deleted.
    """
    queryset = Article.objects.all()
    serializer_class = ArticleSerializer
    permission_classes = [AllowAny]
    pagination_class = MyPageNumberPagination
